
package org.puremvc.as3.multicore.demos.flex.hellopipes.shell.controller
{
    import org.puremvc.as3.multicore.demos.flex.hellopipes.shell.model.MessagesProxy;
    import org.puremvc.as3.multicore.demos.flex.hellopipes.shell.view.HelloPipesShellMediator;
    import org.puremvc.as3.multicore.demos.flex.hellopipes.shell.view.ShellJunctionMediator;
    import org.puremvc.as3.multicore.interfaces.ICommand;
    import org.puremvc.as3.multicore.interfaces.INotification;
    import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	/**
	 * Startup the Main Application/Shell.
	 */
    public class StartupCommand extends SimpleCommand implements ICommand
    {
        override public function execute(note:INotification):void
        {
			// Create and Register the Application Junction and its Mediator
 			facade.registerMediator( new ShellJunctionMediator() );

			// Create and Register the Application and its Mediator
	       	var app: HelloPipesShell = note.getBody() as HelloPipesShell;
       		facade.registerMediator( new HelloPipesShellMediator( app ) );
       		
       		//
       		// register proxy
       		facade.registerProxy( new MessagesProxy() );

        }
        
    }
}